import router from "./router";
import store from './store/index'
const whitelist = ['/login']
router.beforeEach((to,from)=>{
    if(whitelist.includes(to.path)) return true
    const {token} = store.state
    if(token){
        return true
    }else{
        return '/login'
    }
})